/*
 * This is the NI to Model Controller INTERFACE
 */
package model;

import java.net.InetAddress;
import java.nio.file.Path;
import java.util.ArrayList;

/**
 *
 * @author gb
 */
public interface ChatNI2ModelCtrlr {

    /**
     * Gets the username.
     *
     * @return username
     */
    public String getUsername();

    /**
     * Set the net username. A net UserName is : name@ip (ex : gab@192.168.1.3)
     *
     * @param netname The remote user name
     */
    public void setNetUsername(String netname);

    /**
     * Get the net username.
     *
     * @return netUsername
     */
    public String getNetUsername();

    /**
     * Set the broadcast IP address.
     *
     * @param bdip The broadcast IP address
     */
    public void setBroadcastIpAddress(InetAddress bdip);

    /**
     *
     * Get the broadcast IP address.
     *
     * @return bdip
     */
    public InetAddress getBroadcastIpAddress();

    /**
     * Adds the user net name to the list of connected users. Updates the
     * observers.
     *
     * @param remoteNetname The remote user name
     */
    public void addUserToList(String remoteNetname);

    /**
     * Deletes the user net name from the list of connected users. Updates the
     * observers.
     *
     * @param remoteUsername The remote user name
     */
    public void delUserFromList(String remoteUsername);

    /**
     * Add to the Chat Messages a new text message that has been received.
     * Updates the observers.
     *
     * @param message The received message
     * @param from The name of the sender
     * @param to The list of receivers
     */
    public void addReceivedTextMessage(String message, String from, ArrayList<String> to);

    /**
     * Add to the Chat Messages a new text message that has been sent. Updates
     * the observers.
     *
     * @param message The message to send
     * @param to The list of receivers
     */
    public void addSentTextMessage(String message, ArrayList<String> to);

    /**
     * Add to the Chat Messages a new text message to notify that a file has
     * been received. Updates the observers.
     *
     * @param filename The name of the file
     * @param from The name of the sender
     * @param to The list of receivers
     * @param boolReceived The state of the reception
     */
    public void addTextNotifyFileReceived(String filename, String from, ArrayList<String> to, boolean boolReceived);

    /**
     * Add to the Chat Messages a new text message to notify that a file has
     * been sent. Updates the observers.
     *
     * @param filename The name of the file
     * @param remoteUsername The remote user name
     * @param boolTransmitted The state of the transmission
     */
    public void addTextNotifyFileTransmitted(String filename, String remoteUsername, boolean boolTransmitted);

    /**
     * Remembers a file proposal Sends the file proposal
     *
     * @param fileName The name of the file
     * @param filePath The path of the file
     * @param curRmUser The remote user name
     */
    public void rememberFileProposal(String fileName, Path filePath, String curRmUser);

    /**
     * Gets the file path Used for sending a file
     *
     * @param fileName The name of the file
     * @param remoteNetname The remote user name
     * @return the Path corresponding to this filename and remoteNetname couple
     */
    public Path getFilePathForProposal(String fileName, String remoteNetname);

    /**
     * Forgets a file proposal Used when file has proposal has been taken care
     * of
     *
     * @param fileName The name of the file
     * @param remoteNetname The remote user name
     */
    public void forgetFileProposal(String fileName, String remoteNetname);

}
